<template>
  <div></div>
</template>

<script>
export default {
    name:'NoLogin',
    mounted(){
        let time = setTimeout(()=>{
            this.$alert('你还未登录,5秒后跳转到登录页面', '提示', {
                confirmButtonText: '立刻跳转',
                showClose:false,
                callback: action => {
                    this.$router.replace({
                        name:'RegisterAndLogin'
                    })
                }
            })
            let time2 = setTimeout(()=>{
                //关闭弹窗
                let messageBox = document.getElementsByClassName("el-message-box__wrapper");
                let model = document.getElementsByClassName("v-modal");
                if(messageBox){
                    messageBox[0].parentNode.removeChild(messageBox[0]);
                    model[0].parentNode.removeChild(model[0]);
                }
                this.$router.replace({
                    name:'RegisterAndLogin'
                })
                clearTimeout(time2)
            },5000)
            clearTimeout(time)
        },100)

    }
}
</script>

<style>

</style>